<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    {include file="common/head_static" /}
</head>
<style>
    .conten_nav{
/*        background-color: #1a6fa8;
        color: #0C0C0C;*/
    }
    .layui-tab-title {
        position: relative;
        left: 0;
        height: 40px;
        white-space: nowrap;
        font-size: 0;
        border-bottom-width: 1px;
        border-bottom-style: solid;
        transition: all .2s;
        -webkit-transition: all .2s;
        color: #161717;
    }
    .layui-tab-title li {
        display: inline-block;

        vertical-align: middle;
        font-size: 16px;
        transition: all .2s;
        /* -webkit-transition: all .2s; */
        position: relative;
        line-height: 40px;
        min-width: 65px;
        padding: 0 15px;
        text-align: center;
        cursor: pointer;
    }
</style>
<body>
<div class="layui-tab conten_nav">
    <ul class="layui-tab-title">
        <li class="layui-this">语音设置</li>
        <li>账号配置</li>
        <li>信息修改</li>
    </ul>
    <div class="layui-tab-content">

        <div class="layui-tab-item layui-show">
            <div class="layui-row">
                <div class="layui-col-md4">
                    <form action="" method="post">
                        {include file="common/voice_conf" /}
                        <button class="btn btn-primary" type="submit">修改配置</button>
                </div>
            </div>
        </div>
        <div class="layui-tab-item">
            <div class="layui-row">
                <div class="layui-col-md4">
                        <table class="layui-table" lay-even lay-skin="nob">
                            <colgroup>
                                <col width="30">
                                <col width="200">
                            </colgroup>
                            <thead>
                            <tr>
                                <th>apiKey</th>
                                <th>
                                    <input type="text" name="apiKey"autocomplete="off" class="layui-input" value="{$res[0]}">
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>secretKey</td>
                                <td>
                                    <input type="text" name="secretKey"autocomplete="off" class="layui-input" value="{$res[1]}">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <button class="btn btn-primary" type="submit">修改账号</button>
                    </form>
                </div>
            </div>
        </div>

        <div class="layui-tab-item">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <table class="layui-table" lay-even lay-skin="nob">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>名称</th>
                            <th>标识</th>
                            <th>内容</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.name}</td>
                                <td>{$vo.card}</td>
                                <td>{$vo.text}</td>
                                <td>
                                    <button class="btn btn-primary" type="button" onclick="submit({$vo.id})">修改</button>
                                    <a class="btn btn-primary" href="{:url('admin/system/renew',['id'=>$vo['id']])}">更新配置</a>
                                </td>
                            </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function(){
        var element = layui.element;

        //…
    });
    function submit(id){
        $.ajax({
            type:"get",
            url: "{:url('admin/system/revise')}",
            data: {
                id:id,
            },
            success: function(data){
                var index = layer.open({
                    type: 1,
                    title: "添加",
                    shadeClose: true,
                    shade: 0.4,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['400px', '300px'], //宽高
                    content: data
                });
            }});
    }
</script>
</html>